package com.bootdo.common.utils.share;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/wx/share")
public class shareUtils {
	public static String  appid="wxe2b7e12d340a056e";
	public static String appsecret="2eab69601d000b27062cb0fcd81cc5a7";
	//String url="http://os.suyongw.com/app/";
	@ResponseBody
	@GetMapping("/getSignature")
	public Map<String, String> getSignature(String url){
		System.out.println("!!!!!"+url);
		String accessToken = GetAccessTokenUtil.getAccessToken(appid,appsecret).get("accessToken");
		//String accessToken = uniteGetAccessToken.getToken(appid,appsecret);
		String ticket = JsapiTicketUtil.JsapiTicket(accessToken).get("ticket");
		return sign.sign(ticket, url);
	}
	
	public static void main(String[] args) {
		shareUtils shareUtils = new shareUtils();
		Map<String, String> signature = shareUtils.getSignature("http://qq.com");
		System.out.println(signature);

	}
	

	
}
